package com.xk857.feign;

import com.xk857.entities.SysMenu;
import com.xk857.entities.SysUser;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * @author CV大魔王
 * @Description 系统管理Feign接口
 * @date 2021/2/26 21:28
 */
@FeignClient(value = "xk857-system", path = "/system")
public interface IFeignSystemController {

    @ApiImplicitParam(name = "username", value = "用户名", required = true)
    @ApiOperation("Feign接口-通过用户名查询用户信息")
    @GetMapping("/pub/feign/user/{username}")
    SysUser findUserByUsername(@PathVariable("username") String username);


    @ApiImplicitParam(name = "username", value = "用户ID", required = true)
    @ApiOperation("Feign接口-通过用户id查询拥有权限")
    @GetMapping("/pub/feign/menu/{userId}")
    List<SysMenu> findMenuByUserId(@PathVariable("userId") String userId);


    @ApiImplicitParam(name = "id", value = "用户ID", required = true)
    @ApiOperation("Feign接口-通过用户名查询用户信息")
    @GetMapping("/pub/feign/user/id/{id}")
    SysUser findUserByUserId(@PathVariable("id") String id);


    @ApiImplicitParam(name = "id", value = "用户ID", required = true)
    @ApiOperation("Feign接口-通过卡号查询用户信息")
    @GetMapping("/pub/feign/user/card/{card}")
    SysUser findUserByUserCard(@PathVariable("card") String card);
}
